﻿using System;

namespace TfsPolicyPack.CustomRegexPathPolicy
{
    [Serializable]
    public class PolicyInfo
    {
        #region Properties

        public int Occurrence { get; private set; }
        public string Type { get; private set; }
        public string UniqueName{ get { return Occurrence > 1 ? string.Format("{0} - {1}", Type, Occurrence) : Type; } }

        #endregion

        #region Constructor

        public PolicyInfo(string policyType, int occurrence)
        {
            Type = policyType;
            Occurrence = occurrence;
        }

        #endregion

        #region Public Methods

        public override string ToString()
        {
            return UniqueName;
        }

        #endregion
    }
}